<script type="text/javascript">
    $(document).ready(function (e) {
        dialog('.menuParentSet', {
            autoOpen: false,
            modal: true,
            title: "选择父级菜单",
            minWidth: 500,
            maxHeight: 400
        });
        LC.S.id = '${menu._id}';
        LC.S.edit('.menuDetail .edit', LC.S.serviceUrl + LC.S.URL_UPDATE, '${menu._id}');
        LC.S.changeParent = function (e) {
            if ($('.menuParentSet').attr('none') != undefined) {
                $('.menuParentSet').removeAttr('none');
                $('.menuParentSet').load(LC.S.serviceUrl + '/parent.do?id=' + LC.S.id, function () {
                    $('.menuParentSet').dialog('open');
                });
            } else {
                $('.menuParentSet').dialog('open');
            }
        };
        $('.menuDetail .menuLocation').click(LC.S.changeParent);
        var parentSet = $('<span class="icon-edit"></span>').click(LC.S.changeParent);
        $('.menuLocation').after(parentSet);
    });
</script>
<div class="panel panel-default">
    <div class="panel-heading">菜单详情</div>
    <div class="panel-body form-horizontal menuDetail">
        <input type="hidden" name="menuId" value="${menu._id}">
        <div class="form-group">
            <label class="col-sm-2 control-label">编 号：</label>
            <div class="col-sm-8"><p class="menuId form-control-static">${menu._id}</p></div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">名 称：</label>
            <div class="col-sm-4">
                <p class="edit form-control-static" etype="text" regx="${check.name}" name="NAME">${menu.name}</p>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">位 置：</label>
            <div class="col-sm-8">
                <ol class="breadcrumb tree-position menuLocation">
                    <li>顶级</li>
                <#list parents as parent><li>${parent.name}</li></#list>
                </ol>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">地 址：</label>
            <div class="col-sm-8">
                <p class="edit form-control-static" etype="text" regx="${check.url}" name="URL" >${menu.url}</p>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">优先级：</label>
            <div class="col-sm-3">
                <p class="edit form-control-static" etype="number" regx="${check.index}" name="INDEX">${menu.index}</p>
            </div>
        </div>
        <div class="menuParentSet" none>
            <img class="loading-img" src="images/loading.gif"/>
        </div>
    </div>
</div>